<link rel="stylesheet" href="__STATIC__/admin/css/login.css?v={$version}" media="all">
<div class="main-body">
    <div class="login-main">
        <div class="login-top">
            <span>账号注册</span>
            <span class="bg1"></span>
            <span class="bg2"></span>
        </div>
        <!-- <form class="layui-form login-bottom" method="post"> -->
        <form class="layui-form login-bottom" >
            <div class="center">

                <div class="item">
                    <span class="icon icon-2"></span>
                    <input type="text" name="username" lay-verify="required"  placeholder="请输入登录账号" maxlength="24"/>
                </div>

                <div class="item">
                    <span class="icon icon-3"></span>
                    <input type="password" name="password" lay-verify="required"  placeholder="请输入密码" maxlength="20">
                    <span class="bind-password icon icon-4"></span>
                </div>
                <div class="item">
                    <span class="icon icon-3"></span>
                    <input type="password" name="passwords" lay-verify="required"  placeholder="请再次输入密码" maxlength="20">
                </div>

                {if $captcha == 1}
                <div id="validatePanel" class="item" style="width: 137px;">
                    <input type="text" name="captcha" placeholder="请输入验证码" maxlength="4">
                    <img id="refreshCaptcha" class="validateImg"  src="{:url('login/captcha')}" onclick="this.src='{:url(\'login/captcha\')}?seed='+Math.random()">
                </div>
                {/if}

            </div>
            <div class="tip">
                <span class="login-tip">推荐人ID：<input type="text" name="parent_uid" placeholder="请输入验证码" maxlength="4" value="0" style="width: 30px;" disabled></span>
                <a href="{:__url('admin/login/index')}" class="forget-password" >已有账号？点击登录</a>
            </div>
            <div class="layui-form-item" style="text-align:center; width:100%;height:100%;margin:0px;">
                <button class="login-btn" lay-submit>立即注册</button>
                <button class="login-btn" type="button" style="background-color: #6458cc;" onclick="window.location.href='{$oauth}';">授权注册</button>
                <div class="demo ">授权注册，自动注册和绑定账号。</div>
            </div>
        </form>
    </div>
</div>

<script src="__STATIC__/plugs/jquery-3.4.1/jquery-3.4.1.min.js?v={$version}" charset="utf-8"></script>
<script type="text/javascript">


function getUrlParams (urlStr) {
    // 获取url中"?"符后的字串
    let url = urlStr || location.href;
    let params = {};
    if (url.indexOf('?') != -1) {
        let str = url.substr(url.indexOf('?') + 1);
        let strs = str.split('&');
        for (let i = 0; i < strs.length; i++) {
            params[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
        }
    }
    return params;
}
$(function(){
    if(getUrlParams(window.location.href).id) {
        $("input[name=parent_uid]").val(getUrlParams(window.location.href).id);
    }
});

</script>